<template>
  <div v-loading="loading" element-loading-text="拼命加载中..." class="app-container">
    <!-- 顶部信息 -->
    <el-page-header v-if="showPageHeader" class="box-shadow mb-3" icon="arrow-left" @back="handleGoBack">
      <template #content>
        <span>商户操作</span>
<!--        <DictTag style="margin-left: 1rem" v-model="formData.status" :circle="false" dict-type="shop_status"/>-->
      </template>
      <template #extra>
        <div class="flex items-center">
          <!-- 商户状态 0:草稿 10:审核中 20:审核失败 30:待进件 31:进件中 32:进件失败 33:进件成功 100:已通过 110:已禁用  -->
          <template v-if="!readonly">
            <el-button icon="edit" type="primary" @click="onSubmitForm">保存修改</el-button>
          </template>
          <el-button v-if="readonly" icon="refresh" @click="handleRefresh">刷新信息</el-button>
          <el-button icon="arrow-left" @click="handleGoBack(false)">返回上页</el-button>
        </div>
      </template>
    </el-page-header>

    <div class="app-container-main">
      <el-tabs v-model="activeName">
        <el-tab-pane label="基础信息" name="BaseInfo">
          <el-form ref="formRef" :disabled="readonly" :model="formData" :rules="formRules" label-width="140px">
          <el-row :gutter="12">
            <el-col :md="12">
              <!-- 账户信息 -->
              <el-card class="content-card">
                <div class="el-descriptions__header">
                  <div class="el-descriptions__title">账户信息</div>
                </div>

                  <el-form-item label="商户账号：" prop="account">
                    <el-input v-model="formData.account" :readonly="readonly" placeholder="请输入账号"/>
                  </el-form-item>

                  <el-form-item label="登录密码：" prop="password">
                    <el-input v-model="formData.password" :readonly="readonly" placeholder="请输入密码"/>
                  </el-form-item>

                  <el-form-item label="选择所属商务/代理：">
                    <el-select v-model="formData.mid" :disabled="readonly" placeholder="请选择" filterable>
                      <el-option v-for="item in chainList" :key="item.id" :label="item.name" :value="item.id">
                      </el-option>
                    </el-select>
                  </el-form-item>
              </el-card>
            </el-col>

            <el-col :md="12">
              <!-- 门店设置 -->
              <el-card class="content-card">
                <div class="el-descriptions__header">
                  <div class="el-descriptions__title">商户信息</div>
                </div>
                <el-form-item label="商户名称："  prop="full_name">
                  <el-input v-model="formData.full_name" :readonly="readonly" placeholder="请输入商户名称"/>
                </el-form-item>
                <el-form-item label="商户简称："  prop="short_name">
                  <el-input v-model="formData.short_name" :readonly="readonly" placeholder="请输入商户简称"/>
                </el-form-item>
              </el-card>
              <el-card class="content-card">
                <div class="el-descriptions__header">
                  <div class="el-descriptions__title">联系人信息</div>
                </div>

                <el-form-item label="联系人姓名：" prop="name">
                  <el-input v-model="formData.name" :readonly="readonly" placeholder="请输入联系人姓名"/>
                </el-form-item>
                <el-form-item label="联系人手机号：" prop="phone">
                  <el-input v-model="formData.phone" :readonly="readonly" placeholder="请输入联系人手机号"/>
                </el-form-item>
                <el-form-item label="联系人邮箱：" prop="email">
                  <el-input v-model="formData.email" :readonly="readonly" placeholder="请输入联系人邮箱"/>
                </el-form-item>
              </el-card>
            </el-col>
          </el-row>
        </el-form>
        </el-tab-pane>

        <el-tab-pane label="商户信息" name="BusinessLicense">
          <el-row :gutter="12">
            <el-col :md="12">
              <el-card v-if="shopType == 20" class="content-card">
                <div class="el-descriptions__header">
                  <div class="el-descriptions__title">区域&行业</div>
                </div>
                <el-form ref="industryFormRef" :rules="industryRules" :disabled="readonly" :model="industryData" label-width="100px">
                  <el-form-item label="所属区域：" prop="city_id">
                    <TreeSelect ref="regionTreeRef"
                                v-model="city_name"
                                :render-after-expand="false"
                                :tree-data="areaData"
                                title="请选择开户地区"
                                @selectChange="handleSelectCity"/>
<!--                    v-model="value"-->
<!--                    :data="data"-->
<!--                    check-strictly-->
<!--                    :render-after-expand="false"-->
<!--                    show-checkbox-->
<!--                    style="width: 240px"-->
                  </el-form-item>
                  <el-form-item label="MCC大类：" prop="p_cate">
                    <el-select
                      v-model="industryData.p_cate"
                      placeholder="请选择"
                      filterable
                      @change="handlePCate"
                    >
                      <el-option
                        v-for="item in cateData"
                        :key="item"
                        :label="item"
                        :value="item"
                      />
                    </el-select>
                  </el-form-item>
                  <el-form-item label="MCC小类：" prop="c_cate">
<!--                    selectedCate-->
                    <el-select
                      v-model="industryData.c_cate"
                      placeholder="请选择"
                      filterable
                      @change="handleCCate"
                    >
                      <el-option
                        v-for="item in cateSmallData"
                        :key="item.c_code"
                        :label="item.c_cate"
                        :value="item.c_code+'|'+item.c_cate"
                      />
                    </el-select>
                  </el-form-item>
                  <div class="tips">直付通通道请下载excel表，按照表中数据真实进行填写 <a>点击下载</a> </div>
                </el-form>
              </el-card>
              <el-card v-if="shopType == 20" class="content-card">
                <div class="el-descriptions__header">
                  <div class="el-descriptions__title">企业信息</div>
                </div>
                <el-form ref="companyFormRef" :rules="companyRules" :disabled="readonly" :model="companyData" label-width="120px">
                  <el-form-item label="企业类型：" prop="type">
                    <el-select
                      v-model="companyData.type"
                      placeholder="请选择"
                      filterable
                    >
                      <!-- 企业类型 1:企业商户 2:个体工商户 3:小微商户 -->
                      <el-option label="企业" :value="1"/>
                    <el-option label="个体工商户" :value="2"/>
                    <el-option label="个人商户" :value="3"/>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="应用场景：" prop="object">
                    <el-input v-model="companyData.object" :readonly="readonly" placeholder="交易使用真实场景域名、APP名称、公众号"/>
                  </el-form-item>
                  <el-form-item label="测试账号：" prop="test_account">
                    <el-input v-model="companyData.test_account" :readonly="readonly" placeholder="请输入测试账号"/>
                  </el-form-item>
                  <el-form-item label="测试密码：" prop="test_password">
                    <el-input v-model="companyData.test_password" :readonly="readonly" placeholder="请输入测试密码"/>
                  </el-form-item>
                  <el-form-item label="服务器IP：" prop="server_ip">
                    <el-input v-model="companyData.server_ip" :readonly="readonly" placeholder="请输入服务器IP地址"/>
                  </el-form-item>
                  <el-form-item label="业务场景说明：" prop="desc">
                    <el-input v-model="companyData.desc" type="textarea" :readonly="readonly" placeholder="请说明" :autosize="{ minRows: 2, maxRows: 4 }"/>
                  </el-form-item>

                </el-form>

              </el-card>
            </el-col>

            <el-col :md="12">
              <!-- 营业执照数据 -->
              <BusinessLicense  ref="businessLicenseRef" v-model="licenseData" :readonly="readonly"/>
              <Certificate ref="legalPersonRef" v-model="certificateData" :readonly="readonly"/>
              <el-card v-if="shopType == 20" class="content-card">
                <div class="el-descriptions__header">
                  <div class="el-descriptions__title">实际控制人信息</div>
                </div>
                <el-form ref="controlFormRef" :rules="controlRules" :disabled="readonly" :model="controlData" label-width="120px">
                  <el-form-item label="控制人姓名：" prop="name">
                    <el-input v-model="controlData.name" :readonly="readonly" placeholder="请输入实际控制人姓名"/>
                  </el-form-item>
                  <el-form-item label="身份证号：" prop="idcard_num">
                    <el-input v-model="controlData.idcard_num" :readonly="readonly" placeholder="请输入实控人身份证号"/>
                  </el-form-item>
                  <el-form-item label="持股比例(%)：" prop="stock_radio">
                    <el-input v-model="controlData.stock_radio" :readonly="readonly" placeholder="请输入持股比例"/>
                  </el-form-item>
                  <el-form-item label="开始日期：" prop="start_date">
                    <el-date-picker v-model="controlData.start_date"
                                    class="card-header-extra-action"
                                    clearable
                                    format="YYYY-MM-DD"
                                    placeholder="开始日期"
                                    type="date"
                                    value-format="YYYY-MM-DD"/>
                  </el-form-item>
                  <el-form-item label="结束日期：" prop="end_date">
                    <el-date-picker v-model="controlData.end_date"
                                    class="card-header-extra-action"
                                    clearable
                                    format="YYYY-MM-DD"
                                    placeholder="开始日期"
                                    type="date"
                                    value-format="YYYY-MM-DD"/>
                  </el-form-item>
                </el-form>
              </el-card>
              <BeneficiaryInfo ref="beneficiaryRef" v-model="beneficiaryData" :readonly="readonly"/>
            </el-col>
          </el-row>
        </el-tab-pane>
        <el-tab-pane label="公司信息" name="companyInfo">
          <el-row :gutter="12">
            <el-col :md="12">
              <el-card  class="content-card">
                <div class="el-descriptions__header">
                  <div class="el-descriptions__title">进件场景</div>
                </div>
                <el-form ref="sceneFormRef" :rules="sceneRules" :disabled="readonly" :model="sceneData" label-width="120px">
                  <el-form-item label="场景类型：" prop="type">
                    <el-select
                      v-model="sceneData.type"
                      placeholder="请选择"
                      filterable
                    >
                      <el-option label="线上" :value="1"/>
                      <el-option label="线下" :value="2"/>
                      <el-option label="线下线下" :value="3"/>
                    </el-select>
                  </el-form-item>
                  <div class="el-descriptions__header">
                    <div class="el-descriptions__title">公司信息</div>
                  </div>
                  <el-form-item label="门头照：" prop="out_door_image">
                    <UploadImage v-model="sceneData.out_door_image" :disabled="readonly" :show-delete="true" :show-tip="false"/>
                  </el-form-item>
                  <el-form-item label="店内照：" prop="in_door_image">
                    <UploadImage v-model="sceneData.in_door_image" :disabled="readonly" :show-delete="true" :show-tip="false"/>
                  </el-form-item>
                  <el-form-item  v-if="sceneData.type==1 ||sceneData.type==3" label="公司前台照：" prop="front_desc_image">
                    <UploadImage v-model="sceneData.front_desc_image" :disabled="readonly" :show-delete="true" :show-tip="false"/>
                  </el-form-item>
                  <el-form-item v-if="sceneData.type==2 ||sceneData.type==3" label="收银台台照：" prop="cash_desc_image">
                    <UploadImage v-model="sceneData.cash_desc_image" :disabled="readonly" :show-delete="true" :show-tip="false"/>
                  </el-form-item>
                  <el-form-item label="工作区域照：" prop="work_space_image">
                    <UploadImage v-model="sceneData.work_space_image" :disabled="readonly" :show-delete="true" :show-tip="false"/>
                  </el-form-item>
                </el-form>
              </el-card>
            </el-col>
          </el-row>
        </el-tab-pane>
        <el-tab-pane label="结算信息" name="SettlementAccount">
          <el-row :gutter="12">
            <el-col :md="12">
              <!-- 结算账户 -->
              <SettlementInfo ref="settlementInfoRef"
                              v-model="settlementAccountData"
                              :company-type="companyData.type"
                              :readonly="readonly"
                              :shop-type="shopType"
                              :area-data="areaData"
                              @account-type="handleChangeSettlementAccountType"/>
            </el-col>

            <el-col v-if="settlerData.type== 3" :md="12">
              <!-- 对私非法人账户 -->
              <SettlerDataInfo ref="settlerRef" v-model="settlerData" :readonly="readonly" :settler="true"/>
            </el-col>
          </el-row>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { useRoute, useRouter } from 'vue-router';
import { useTabsNavStore } from '@/store';
import { computed, h, nextTick, onMounted, reactive, ref } from 'vue';
import { ElLoading, ElMessage, ElMessageBox, ElNotification, FormInstance, FormRules } from 'element-plus';
import BusinessLicense from '@/views/components/business-license.vue';
import Certificate from '@/views/components/certificate.vue';
import SettlementInfo from '@/views/components/settlement-info.vue';
import BeneficiaryInfo from '@/views/components/beneficiary-info.vue';
import SettlerDataInfo from '@/views/components/settler-data.vue'
import { BaseCategory, BusinessLicenseData, CertificateData, SettlementAccount, BeneficiaryData ,SettlerData} from '@/api/common.ts';
import {
  mccBigType,
  mccSmallType,
  cityTree, merchantInfo, merchantSave, merchantUpdate,
} from '@/api/api-store.ts';
import { DictTag } from '@/components/dict-tag';
import {UploadImage} from "@/components/upload";
import {TreeSelect} from "@/components/tree-select";
import addressList from '@/utils/address.ts';
import {MANAGERList} from "@/api/api-manager.ts";
defineOptions({name: 'shop-info'});

const props = defineProps({
  id: {
    type: Number,
    required: true
  },
  readonly: {
    type: Boolean,
    default: false
  },
  audit: {
    type: Boolean,
    default: false
  },
  showPageHeader: {
    type: Boolean,
    default: true
  }
});

const shopType = ref(20);
const currentRoute = useRoute();
const tabsNavStore = useTabsNavStore();
const loading = ref(false);
const activeName = ref('BaseInfo');
const account = ref();
/** 默认表单数据 */
const defaultForm: StoreData = <StoreData>{
  id: 0,
  status: 0,
};
const formRef = ref<FormInstance>();
const formData = ref({...defaultForm});
// 表单验证规则
const formRules = reactive<FormRules>({
  account: [{required: true, message: '商户账号不能为空', trigger: 'blur'}],
  password: [{required: true, message: '登录密码不能为空', trigger: 'blur'}],
  full_name: [{required: true, message: '商户名称不能为空', trigger: 'blur'}],
  short_name: [{required: true, message: '商户简称不能为空', trigger: 'blur'}],
  name: [{required: true, message: '联系人姓名不能为空', trigger: 'blur'}],
  phone: [{required: true, message: '联系人手机号不能为空', trigger: 'blur'}],
  email: [{required: true, message: '联系人邮箱不能为空', trigger: 'blur'}],
});

const industryData=ref<object>({})
const industryFormRef=ref<FormInstance>()
const  industryRules= reactive<FormRules>({
  c_cate: [{required: true, message: 'mcc小类不能为空', trigger: 'change'}],
  p_cate:[{required: true, message: 'mcc大类不能为空', trigger: 'change'}],
  city_id:[{required: true, message: '所属区域不能为空', trigger: 'change'}],
});
//企业信息
const companyData=ref<object>({type:1})
const companyFormRef=ref<FormInstance>()
const  companyRules= reactive<FormRules>({
  type: [{required: true, message: '企业类型不能为空', trigger: 'change'}],
  object:[{required: true, message: '应用场景不能为空', trigger: 'blur'}],
  test_account:[{required: true, message: '测试账号不能为空', trigger: 'blur'}],
  test_password: [{required: true, message: '测试密码不能为空', trigger: 'blur'}],
  server_ip:[{required: true, message: '服务器IP不能为空', trigger: 'blur'}],
  desc:[{required: true, message: '业务场景说明不能为空', trigger: 'blur'}],
});
/** 营业执照数据 */
const defBusinessLicense: BusinessLicenseData = <BusinessLicenseData>{};
const licenseData = ref({...defBusinessLicense});

/** 法人信息 */
const defCertificateData: CertificateData = <CertificateData>{};
const certificateData = ref({...defCertificateData});
// 实际控制人
const controlData=ref<object>({})
const controlFormRef=ref<FormInstance>()
const pickerDate = ref([]);
const  controlRules= reactive<FormRules>({
  name:[{required: true, message: '实控人姓名不能为空', trigger: 'blur'}],
  stock_radio:[{required: true, message: '持股比例不能为空', trigger: 'blur'}],
  idcard_num:[{required: true, message: '实控人身份证号不能为空', trigger: 'blur'}],
  start_date:[{required: true, message: '有效期不能为空', trigger: 'blur'}],
  end_date:[{required: true, message: '有效期不能为空', trigger: 'blur'}],
})
const handleChangeDate=(e)=>{
  controlData.value.start_date=e[0]
  controlData.value.end_date=e[1]
}
//受益人信息
const defBeneficiaryData: BeneficiaryData = <BeneficiaryData>{beneficiary:[
    {
        name:'',
        stock_radio:'',
        idcard_num:'',
        start_date: '',
        end_date: '',
    }
  ]};
const beneficiaryData = ref({...defBeneficiaryData});
const beneficiaryRef=ref<FormInstance>()
//公司信息
const defCompanyData: CompanyData = <CompanyData>{};
const sceneData = ref({
  type:1,
  out_door_image:'',
  in_door_image:'',
  front_desc_image:'',
  cash_desc_image:'',
  work_space_image:''
});
const sceneFormRef=ref<FormInstance>()
const sceneRules= reactive<FormRules>({
  type: [{required: true, message: '场景类型不能为空', trigger: 'change'}],
  out_door_image: [{required: true, message: '门头照不能为空', trigger: 'change'}],
  in_door_image: [{required: true, message: '店内照不能为空', trigger: 'change'}],
  front_desc_image: [{required: true, message: '前台照不能为空', trigger: 'change'}],
  cash_desc_image: [{required: true, message: '经营照不能为空', trigger: 'change'}],
  work_space_image: [{required: true, message: '工作照不能为空', trigger: 'change'}],
});
/** 结算账户类型改变 */
const settlementAccountType = ref();
const handleChangeSettlementAccountType = (type?: number) => {
  console.log(type,111111)
  settlementAccountType.value = type;
  settlerData.value = {...defSettlerData};
};
/** 结算账户信息 */
const defSettlementAccount: SettlementAccount = <SettlementAccount>{};
const settlementAccountData = ref({...defSettlementAccount});

/** 对私非法人结算者信息 */
const defSettlerData:SettlerData = <SettlerData>{};
const settlerData = ref({...defSettlerData});
/** 返回上一页 */
const router = useRouter();
const handleGoBack = async (refresh = false) => {
  await tabsNavStore.delView(currentRoute);
  let params = {refresh: refresh ? 1 : 0}
  await router.push({name: 'store-list', state: {params}});
};
const cateTreeRef = ref();
const handleCateSetCurrentNode = () => {
  nextTick(() => {
    cateTreeRef.value?.handleSetCurrentNode(industryData.value.city_id)
  });
};
const chainList=ref<array>([])
const chainListOption=()=>{
  MANAGERList({page:1,size:9999,action:'list'}).then(res=>{
    chainList.value=res.body.list
  })
}
/** 刷新数据 */
const handleRefresh = async () => {
  await handleResetData();
  await initCateTreeData();
  await handelCiteTree();
  await chainListOption()
  await initData(props.id);
};

/** 重置数据 */
const handleResetData = async () => {
  industryData.value={} //区域行业
  companyData.value={type:1} //公司
  licenseData.value= {...defBusinessLicense}//营业执照
  certificateData.value={...defCertificateData}// 法人
  controlData.value={}//控制人
  beneficiaryData.value={...defBeneficiaryData}//受益人
  sceneData.value={
    type:1,
    out_door_image:'',
    in_door_image:'',
    front_desc_image:'',
    cash_desc_image:'',
    work_space_image:''
  }//经营场景
  settlerData.value={...defSettlerData}//结算信息
  // params.settlement.type=settlementAccountData.value.type
 settlementAccountData.value ={...defSettlementAccount}//结算账户
  settlementAccountData.value.type=1
};
//基础信息  formData
// 商户信息 区域 industryData
//企业信息 companyData
//法人信息 certificateData
//实际控制人 controlData
/** 加载信息 */
const initData = async (id: number) => {
  if (!id || id <= 0) return;
  loading.value = true;
  try {
    let params={
      id:id,
      action:'info'
    }
    const {body} = await merchantInfo(params)
    formData.value = body;
    if (formData.value.industry) {
      industryData.value = formData.value.industry;
    }
    if (formData.value.company) {
      companyData.value = formData.value.company;
    }
    if(formData.value.license){
      licenseData.value = formData.value.license;
    }
    if(formData.value.legal){
      certificateData.value = formData.value.legal;
    }
    if(formData.value.control){
      controlData.value = formData.value.control;
    }
    if(formData.value.beneficiary){
      beneficiaryData.value.beneficiary = formData.value.beneficiary;
    }
    if(formData.value.scene){
      sceneData.value = formData.value.scene;
    }
    if(formData.value.bank){
      settlementAccountData.value = formData.value.bank;
      settlementAccountData.value.type= formData.value.settlement.type
    }
    if(formData.value.settlement){
      settlerData.value = formData.value.settlement;
    }
    // handleCateSetCurrentNode();
    handleCitySetCurrentNode()

  } finally {
    loading.value = false
  }
};

/** 数据提交 */
const mapFormRef = ref<FormInstance>();
const imageFormRef = ref<FormInstance>();
const businessLicenseRef = ref();
const legalPersonRef = ref();
const settlementInfoRef = ref();
const settlerRef = ref();
const mapLocationRef = ref();
const onSubmitForm = async () => {
  const v1 = formRef.value?.validate();
  const v2 = industryFormRef.value?.validate();
  const v3=companyFormRef.value?.validate()
  const v4 = businessLicenseRef.value?.formValidate();
  const v5 = legalPersonRef.value?.formValidate();
  const v6=controlFormRef.value?.validate()
  const v7 = beneficiaryRef.value?.formValidate();
  const v8=sceneFormRef.value?.validate()
  const v9 = settlementInfoRef.value?.formValidate();
  const v10 = settlerRef.value?.formValidate();
  // 多表达验证
  Promise.all([v1, v2, v3, v4, v5, v6, v7, v8,v9,v10]).then((res) => {
  let params=Object.assign({}, formData.value)
    params.industry=industryData.value //区域行业
    params.company=companyData.value //公司
    params.license=licenseData.value//营业执照
    params.legal=certificateData.value// 法人
    params.control=controlData.value//控制人
    params.beneficiary=beneficiaryData.value.beneficiary//受益人
    params.scene=sceneData.value//经营场景
    params.settlement=settlerData.value//结算信息
    params.settlement.type=settlementAccountData.value.type
    params.bank=settlementAccountData.value //结算账户
    console.log(params,99999999999,"测试测试")
    const loading = ElLoading.service({
      lock: true,
      text: '正在提交中...',
      background: 'rgba(0, 0, 0, 0.2)'
    })
    if(props.id<=0){
      // 提交数据
      merchantSave(params, {action:'add'}).then(response => {
        // 提示信息
        ElNotification({title: '成功', message: '操作成功', type: 'success', duration: 2000})
        if (params.id <= 0) {
          // 返回上页
          handleGoBack(true);
        }
      }).finally(() => loading.close())
    }else{
      merchantUpdate(params, {action:'update'}).then(response => {
        // 提示信息
        ElNotification({title: '成功', message: '操作成功', type: 'success', duration: 2000})
        // if (params.id <= 0) {
          // 返回上页
          handleGoBack(true);
        // }
      }).finally(() => loading.close())
    }

  }).catch((e) => {
    console.log(e)
    // 校检不通过
    ElMessage({type: 'error', message: '请检查是否有必填项未完善',});
  })
};

/** mcc大类 */
const cateData = ref<BaseCategory[]>([]);
const cateTreeLoading = ref(false)

/** 加载mcc大类 */
const initCateTreeData = async () => {
  cateTreeLoading.value = true
  try {
    const {body} =  await mccBigType({action:'parent'})
    cateData.value = body
  } finally {
    cateTreeLoading.value = false
  }
};
const cateSmallData=ref<BaseCategory[]>([]);
const selectedCate= ref([]);
const handlePCate=async (e)=>{
  try {
    const {body} =  await mccSmallType({cate:e,action:'list'})
    cateSmallData.value = body
  } finally {

  }
}
const handleCCate=async  (e)=>{
  let data=e.split("|")
  industryData.value.c_cate=data[1]
  industryData.value.c_code=data[0]
}
//所选区域
const areaData =ref<BaseCategory[]>([]);
const handelCiteTree=async ()=>{
  try {
    const {body} =  await cityTree({action:'tree'})
    areaData.value = body
    //
  } finally {

  }
}
/** 处理分类选中 */
const city_name=ref()
const regionTreeRef = ref();
const handleSelectCity = (item?: any) => {
  industryData.value.city_id = item
};
const handleCitySetCurrentNode = () => {
  nextTick(() => {
    regionTreeRef.value?.handleSetCurrentNode(industryData.value.city_id)
  });
};
//
onMounted(async () => {
  await handleRefresh();
});

</script>

<style lang="scss" scoped>
.app-container-main {
  .el-form-item {
    margin-bottom: 16px !important;
  }

  :deep(.el-form-item__content) {
    max-width: 36rem;
  }

  .el-input-number {
    max-width: 10rem;
  }

  .el-descriptions__title {
    border-left: 3px solid var(--el-color-primary);
    padding-left: 10px;
    font-weight: 500;
    font-size: 14px;
    line-height: 16px;
  }
}
.tips{
  width: 100%;
  margin-left: 90px;
  font-size: 12px;
  color: red;
  a{
    color: #1a53ff;
  }

}
</style>
